<%-- 
    Document   : updateadmin
    Created on : May 1, 2012, 3:16:02 PM
    Author     : Luong
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib  uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib  uri="http://java.sun.com/jsf/html"  prefix="h"%>
<link href="style_admin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="JQuery/jquery.js"></script>
<script type="text/javascript" src="JQuery/additional-methods.js"></script>
<script type="text/javascript" src="JQuery/jquery.validate.js"></script>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Tunga Restaurant</title>
        <script type="text/javascript">
            $(function(){
                $("#testform").validate({
                    rules:{
                        txtname:{
                            required:true
                        },
                        txtde:{
                            required:true
                        },
                        txtpr:{
                            required:true,
                            number:true,
                            digits:true
                        },
                        fileUp:{
                            accept:"bmp|png|jpg"
                        }
                    }
                })
            });
        </script>
    </head>
    <body>
        <center>
            <c:set var="session" value="${sessionScope.user}"/>
            <c:if test="${empty session}">
                <script>
                    function h()
                    {
                        window.location="index.jsp"
                    }
                </script>
            </c:if>
            <div class="outer">
                <!--Header end-->
                <div id="rc1"></div>
                <div id="bg">
                    <div class="toplinks"><a href="ContactUs.jsp">Contact us</a></div><div class="sap">|</div>
                    <div class="toplinks"><a href="initShowFood?action=Food">Food</a></div><div class="sap">|</div>
                    <div class="toplinks"><a href="ControllerTables?action=Table">Table</a></div><div class="sap">|</div>
                    <div class="toplinks"><a href="ControllerRooms?action=Room">Room</a></div><div class="sap">|</div>
                    <c:if test="${empty session}">
                        <div class="toplinks"><a href="registration.jsp">Register</a></div><div class="sap">|</div>
                        <div class="toplinks"><a href="login.jsp">Login</a></div><div class="sap">|</div>
                    </c:if>
                    <div class="toplinks"><a href="index.jsp">Home Page</a></div>
                    <div><font color="white">Welcome, </font><font color="yellow">${sessionScope.user}</font> </div>
                    <div>
                        <font color="yellow"><a href="ControllerCustomer?action=Information&user=${sessionScope.user}">Your information</a></font>
                        <%
                                    if (session.getAttribute("isadmin") != null) {
                        %>
                        <a href="index_admin.jsp">Admin Manager</a>
                        <%                                    }
                        %>
                        <font color="yellow">
                            <c:url var="LogOut" value="ControllerCustomer">
                                <c:param name="action" value="LogOut"/>
                            </c:url>
                            <a href="${LogOut}">LogOut</a>
                        </font>
                    </div>
                </div>
                <div id="rc2"></div>
                <div id="header">
                    <div class="name">Tunga Restaurant Admin Manager</div>
                    <div class="tag">The best restaurant in the world</div>
                </div>
                <!--Top nav end-->
                <div style="clear:left"></div>
                <div id="outer2">
                    <div id="left-nav">
                        <div class="leftlinks">
                            <span class="heading">Manage</span>
                            <ul>
                                <li><a href="ControllerCustomer?action=Customer">Customer</a></li>
                                <li><a href="ControllerFood?action=adminFood">Food</a></li>
                                <li><a href="ControllerAdminRooms?action=AdminRooms">Room</a></li>
                                <li><a href="ControllerTables?action=AdminTables">Table</a></li>
                                <li><a href="ControllerOrderFood?action=adminOrderFood">Order Food</a></li>
                                <li><a href="ControllerAdminBookRooms?action=AdminBookRooms">Book Room</a></li>
                                <li><a href="ControllerTables?action=AdminBookTables">Book Table</a></li>
                                <li><a href="report.jsp">Report</a></li>
                            </ul>
                        </div>
                    </div><div class="inner_copy"><div class="inner_copy">All <a href="http://www.magentothemesworld.com" title="Best Magento Templates">premium Magento themes</a> at Magentothemesworld.com!</div></div>
                    <div id="content" align="center">
                        <span class="heading">Update Food </span>
                        <div id="main">
                            <c:set var="all" value="${applicationScope.updateFood}"/>
                            <c:if test="${not empty all}">
                                <c:forEach var="rows" items="${all}">
                                    <div align="center">
                                        <c:set var="load" value="${applicationScope.data}"/>
                                        <form action="ApacheUploadFood" method="POST"  ENCTYPE="multipart/form-data" id="testform">

                                            <table border="0" align="center">

                                                <input type="hidden" name="txtidf" value="${rows.foodID}"/>
                                                <tbody>
                                                    <tr>
                                                        <td>Food Name:</td>
                                                        <td><input type="text" name="txtname" value="${rows.foodName}"/></td>
                                                    </tr>
                                                    <tr>
                                                        <td>Your Category:</td>
                                                        <td><input type="text" name="txtyourcate" value="${rows.categoryFoods.caFoodName}" readonly /></td>
                                                    </tr>
                                                    <tr>
                                                        <td>Category Food:</td>
                                                        <td>
                                                            <select name="txtca">
                                                                <c:forEach var="al" items="${load}">
                                                                    <option value="${al.caFoodID}">${al.caFoodName}</option>
                                                                </c:forEach>
                                                            </select>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>Description:</td>
                                                        <td><textarea type="text" name="txtde" rows="10" cols="30">${rows.description}</textarea></td>
                                                    </tr>
                                                    <tr>
                                                        <td>Price:</td>
                                                        <td><input type="text" name="txtpr" value="${rows.price}"/></td>
                                                    </tr>
                                                    <tr>
                                                        <td>Picture:</td>
                                                        <td><input type="hidden" name="pic" value="${rows.picture}"/><img  src="${rows.picture}"/></td>
                                                    </tr>
                                                    <tr>
                                                        <td>File:</td>
                                                        <td>
                                                            <input type="file" name="fileUp" size="20" />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td></td>
                                                        <td><input type="submit" value="Update Food" name="action" /> &nbsp;&nbsp;<input type="button" value="Cancel" onclick="history.go(-1);"/></td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </form>
                                    </div>

                                </c:forEach>
                            </c:if>

                        </div>
                    </div>
                    <div style="clear:left"></div>
                </div>
                <!--Bottom part-->
                <div id="bottom">
                    <div id="footer"><div class="fcenter">GROUP02-F5-10-1009-S1</div></div>
                </div>
            </div>
        </center>

    </body>
</html>
